package easy;

public class Day14 {
    public static void main(String[] args) {

    }

    public static int[] plusOne(int[] digits) {
        for (int index = digits.length - 1; index >= 0; index--) {
            digits[index]++;
            if (digits[index] != 10) {
                return digits;
            }
            digits[index] = 0;
        }
        digits = new int[digits.length + 1];
        digits[0] = 1;
        return digits;
    }
}
